<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>柱状图</title>

    <script th:src="@{js/echarts.min.js}"></script>
    <script th:src="@{js/jquery-3.3.1.js}"></script>

</head>
<body>
<div id="main" style="width: 600px;height:400px;"></div>

<script th:inline="javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('main'));

    // 指定图表的配置项和数据
    var option = {
        title: {
            text: '词频柱状图'
        },
        tooltip: {},
        legend: {
            data:['词频']
        },
        xAxis: {
            data: [[${strings}]]
        },
        yAxis: {},
        series: [{
            name: '词频',
            type: 'bar',
            data: [[${values}]]
        }]
    };

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
</script>
</body>
</html>